<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\AdminuserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '用户管理页面';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="adminuser-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <p>
        <?= Html::a('创建用户', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            [
                'class'=>'yii\grid\CheckboxColumn'
            ],
            'id',
            'username',
//            'auth_key',
//            'password_hash',
//            'password_reset_token',
            'email:email',
            'role',
            'status',
            [
                "attribute" => "created_at",
                "format" => ["date", "php:Y-m-d H:i:s"],
            ],
            [
                "attribute" => "updated_at",
                "format" => ["date", "php:Y-m-d H:i:s"],
            ],
            ['class' => 'yii\grid\ActionColumn'],
        ],
        'emptyText'=>'当前没有会员',
        'emptyTextOptions'=>['style'=>'color:red;font-weight:bold'],
        'layout'=>"{items}\n{pager}",
        'showOnEmpty'=>false
    ]); ?>
</div>


